package com.apes.fn.scm.merchant.account.model;

import com.apes.fn.scm.retailOrder.model.BusinessOrderType;
import lombok.Getter;

import java.util.Arrays;
import java.util.Objects;

/**
 * @BelongsProject: apes-server
 * @BelongsPackage: com.apes.fn.scm.merchant.account.model
 * @ClassName: SettlementFormEnum
 * @Author: pyb
 * @CreateTime: 2021-10-01 17:03
 * @Description: 结算界面表单枚举
 * @Version: 1.0
 */
@Getter
public enum SettlementFormEnum {
    lossNotRefund("lossNotRefund", "定损未回款", "income.summary.fixedLoss"),
    RECEIVABLE("receivable", "应收账款", "receivableIn.breakdown"),
    RECEIVABLE_OUT("receivableOut", "应收账款-平台外", "receivableOut.breakdown"),
    CASH("cash", "货币资金", "payment.breakdown"),
    CROSS_INCOME("crossIncome", "会员跨公司消费-收入","settle.cross.company.income"),
    CROSS_PAY("crossPay", "会员跨公司消费-支出", "settle.cross.company.pay"),
    DERATE("derate", "品类减免","income.summary.findFeeReducedDetail"),
    INTERNAL_DERATE("internalDerate", "同接入商内部销售减免", "income.summary.findInternalDetail"),
    LOSS_DERATE("lossDerate", "基地定损减免","income.summary.findLossAssessmentCost"),
    BORROW_MONEY("BORROW_MONEY", "预支款", "expenditure.business.settlement"),
    CONSIGN_MONEY("CONSIGN_MONEY", "代销商品货款", "expenditure.voucher.consign"),
    DRAINAGE_COST("DRAINAGE_COST", "三方平台引流成本", "expenditure.drainage.cost"),
    INSURANCE_FEE("INSURANCE_FEE", "车险销售管理费", "expenditure.insurance.fee"),
    OWN_MONEY("OWN_MONEY", "经销商品货款", "expenditure.voucher.own"),
    PLATFORM_FEE("PLATFORM_FEE", "平台费用", "expenditure.expense.form"),
    QUOTATION_FEE("QUOTATION_FEE", "定损介绍费", "expenditure.quotation.fee"),
    SUPPLY_CHAIN_FEE("SUPPLY_CHAIN_FEE", "供应链管理费", "expenditure.management.fee.form"),
    UN_DEPOSITED("UN_DEPOSITED", "门店现金未存款", "settlement.error.form");
    String settlementType;
    String settlementTypeName;
    String fromId;

    SettlementFormEnum(String settlementType, String settlementTypeName, String fromId) {
        this.settlementType = settlementType;
        this.settlementTypeName = settlementTypeName;
        this.fromId = fromId;
    }

    public static SettlementFormEnum getSettlementFormEnumByOrderType(String settlementType) {
        return Arrays.stream(values()).filter(value -> Objects.equals(value.getSettlementType(), settlementType)).findFirst().orElse(null);

    }
}
